<?php if(isset($categories)): ?>
<span>Please note: multiple listings per drink are possible!</span>
    <table class="table-condensed table-striped">
	<tr>
	    <th>Category name</th>
	    <th>Listed recipes</th>
	</tr>
	<?php foreach($categories as $category): ?>
	<tr>
	    <td><?php echo anchor('/category/details/' . $category->id, $category->name, ''); ?></td>
	    <td>
		<?php $count = count($category->drink());
                    echo ($count === 0) ? 0 : anchor('/category/drinks/' . $category->id, count($category->drink()), '') ; ?>
	    </td>
	</tr>
	<?php endforeach; ?>
    </table>
<?php else: ?>
    <div class="error">No categories found!</div>
<?php endif; ?>